<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Digital-Center Backend System</title>
        <meta name="description" content="mobile first, app, web app, responsive, admin dashboard, flat, flat ui">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">	
        <!-- x -->
        <?php
        // Config for Backend Carabiner //
        $carabiner_config = array(
            'script_dir' => 'backend_assets/',
            'style_dir' => 'backend_assets/',
            'cache_dir' => 'backend_assets/cache/',
        );

        $this->carabiner->config($carabiner_config);


        // Asset for CSS //
        $main_css = array(
            array('css/bootstrap.css'),
            array('css/font-awesome.min.css'),
            array('css/font.css'),
            array('css/style.css'),
            array('css/plugin.css'),
            array('css/landing.css'),
            //array('css/wp-theme.css'),
            array('js/select2/select2.css'),
            array('js/textext/textext.core.css'),
            array('js/textext/textext.plugin.autocomplete.css'),
            array('js/textext/textext.plugin.tags.css'),
            array('js/daterangepicker/daterangepicker-bs3.css')
        );

        $this->carabiner->group('main_css', array('css' => $main_css));

        echo $this->carabiner->display('main_css');

        // Additional CSS //
        if (isset($css)) {
            foreach ($css as $row) {
                $additional_css[] = array($row);
            }
            $this->carabiner->group('additional_css', array('css' => $additional_css));
            echo $this->carabiner->display('additional_css');
        }
        ?>

        <!--[if lt IE 9]>
        <?php
        $iefix_js = array(
            array('js/ie/respond.min.js'),
            array('js/ie/html5.js'),
            array('js/ie/excanvas.js')
        );

        $this->carabiner->group('iefix_js', array('js' => $iefix_js));

        echo $this->carabiner->display('iefix_js');
        ?>
        <![endif]-->

        <?php
        // Asset for JS //
        $main_js = array(
            array('js/jquery.min.js'),
            array('js/bootstrap.js'),
            array('js/app.js'),
            array('js/charts/sparkline/jquery.sparkline.min.js'),
            array('js/charts/easypiechart/jquery.easy-pie-chart.js'),
            array('js/fuelux/fuelux.js'),
            array('js/datepicker/bootstrap-datepicker.js'),
            array('js/slider/bootstrap-slider.js'),
            array('js/file-input/bootstrap.file-input.js'),
            array('js/combodate/moment.min.js'),
            array('js/combodate/combodate.js'),
            array('js/parsley/parsley.min.js'),
            array('js/select2/select2.min.js'),
            array('js/daterangepicker/moment.min.js'),
            array('js/daterangepicker/daterangepicker.js'),
            array('js/datatables/jquery.dataTables.min.js'),
            array('js/select2/select2.min.js'),
            array('js/datatables/jquery.dataTables.columnFilter.js'),
            array('js/tinymce/tinymce.min.js'),
            array('js/textext/textext.core.js'),
            array('js/textext/textext.plugin.ajax.js'),
            array('js/textext/textext.plugin.autocomplete.js'),
            array('js/textext/textext.plugin.tags.js'),
            array('js/bootbox.min.js'),
            array('js/app.plugin.js')
        );

        $this->carabiner->group('main_js', array('js' => $main_js));

        echo $this->carabiner->display('main_js');


        // Additional JS //
        if (isset($js)) {
            foreach ($js as $row) {
                $additional_js[] = array($row);
            }
            $this->carabiner->group('additional_js', array('js' => $additional_js));
            echo $this->carabiner->display('$additional_js');
        }
        ?>


    </head>
    <body>
        <div id="wrapper">
            <!-- header -->
            <?php if (is_loggedin()): ?>
                <div role="navigation" class="navbar navbar-inverse navbar-fixed-top">
                        <div class="navbar-header">
                            <a href="#" class="navbar-brand"><span id="logo"></span><span class="site_name">Project name</span></a>
                        </div>

                        <div class="collapse navbar-collapse navbar-ex1-collapse">                        

                            <?php $member = $this->session->userdata('is_loggedin'); ?>
                            <ul class="nav navbar-nav navbar-right">
                                <li class="dropdown">
                                    <a data-toggle="dropdown" class="dropdown-toggle" href="#"><?php echo $member['member_firstname'] . ' ' . $member['member_lastname']; ?> <b class="caret"></b></a>
                                    <ul class="dropdown-menu">
                                        <li><a href="<?php echo base_url('backend/member/edit'); ?>">Edit Profile</a></li>
                                        <li><a href="<?php echo base_url('backend/auth/logout'); ?>">Logout</a></li>
                                    </ul>
                                </li>
                            </ul>
                            
                            <?php echo $side_menu; ?>
                    </div><!--/.nav-collapse -->

            </div>
            <?php endif; ?>
            <!-- / header -->   

            <!-- Page content -->
            <div id="page-wrapper">
                <?php echo $content; ?>
            </div>
        </div>

    </body>
</html>